package com.jdkreader.concurrency.concurrent.performance;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class LockingTest extends Incrementable{

    private Lock lock=new ReentrantLock();

    @Override
    public void increment() {
        lock.lock();
        try{
            ++counter;
        }finally{
           lock.unlock();
        }
    }
}
